package novel.mzx.com.adapter;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

import novel.mzx.com.R;
import novel.mzx.com.bean.CommentBean;
import novel.mzx.com.http.Api;
import novel.mzx.com.views.XCRoundImageView;



public class CommentAdapter extends CommonAdapter<CommentBean.Data> {
    Context mContext;

    public CommentAdapter(Context context, int layoutId, List<CommentBean.Data> datas) {
        super(context, layoutId, datas);

        mContext = context;

    }

    @Override
    protected void convert(ViewHolder holder, final CommentBean.Data s, int position) {
        XCRoundImageView news_img = holder.getConvertView().findViewById(R.id.news_img);
        holder.setText(R.id.tv_01,s.getCommentName());
        holder.setText(R.id.tv_02,s.getCommentContent());
        Glide.with(mContext).load(Api.mainImgHost+s.getCommentLogo()).asBitmap().into(news_img);
    }

}
